package service.facade.admin;

import domain.ImageEntry;
import domain.User;
import domain.shop.*;

import javax.xml.bind.JAXBException;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.util.List;
import java.util.Map;
import java.util.Set;

public interface ShopAdminService {

    void setProductMainImage(Long productId, Long imageId) throws Exception;

    boolean activateAccount(User user) throws Exception;

    void importProductsFromXML(InputStream is) throws JAXBException, FileNotFoundException, Exception;

    void setProductToCategories(Long productId, Map<Long, Boolean> categories) throws Exception;


    void removeProductFromCategory(Long productId, Long categoryId) throws Exception;


    void addProductToCategory(Long productId, Long categoryId) throws Exception;


    void addProductToCategory(Product product, Category category) throws Exception;


    void removeProductFromCategory(Product product, Category category) throws Exception;

    boolean deactivateAccount(User user) throws Exception;


    Product findProductById(Long Id);


    Product createProduct() throws Exception;


    List<Product> findAllProducts();


    void addProductAttribute(Product product) throws Exception;


    void deleteProductAttribute(Product product, Attribute attribute) throws Exception;


    Set<Long> getCategoryIdsByProduct(Long productId);


    List<Category> getRootCategories();


    void deleteProduct(Product product) throws Exception;


    Set<Product> findRelatedProductsByProductId(Long productId);


    Category createCategoryAsChild(Category category) throws Exception;


    Category findCategoryById(Long Id);


    Category createCategory() throws Exception;


    void deleteCategory(Category category);


    void updateCategory(Category category) throws Exception;


    List<Category> findCategoryRoots();


    List<Category> findCategoryChildsByParentId(Long Id);


    DeliveryMethod findDeliveryMethodById(Long Id);


    void deleteDeliveryMethod(DeliveryMethod deliveryMethod);


    void updateDeliveryMethod(DeliveryMethod deliveryMethod) throws Exception;


    List<DeliveryMethod> findAllDeliveryMethods();


    DeliveryMethod createDeliveryMethod() throws Exception;


    void deletePayMethod(PayMethod payMethod);


    void updatePayMethod(PayMethod payMethod) throws Exception;


    PayMethod createPayMethod() throws Exception;


    PayMethod findPayMethodById(Long Id);


    List<PayMethod> findAllPayMethods();


    void setRelatedProducts(Long mainProductId, Set<Long> relatedProducts) throws Exception;


    void setComponentsOfProduct(Long mainProductId, Set<Long> componentsOfProducts) throws Exception;

    void addImageToProduct(Product product, ImageEntry image) throws Exception;

    void updateProduct(Product product) throws Exception;

    Attribute addProductAttribute(Product product, Attribute attribute) throws Exception;

    List<Product> findProductsByIdLike(Long input);

    Iterable<Product> findProducts(int first, int count, String property, boolean ascending);

    int getProductsCount();

    List<User> findUsers(int first, int count, String property, boolean ascending);

    User findUserById(Long id);

    int getUsersCount();


}
